package com.qst.repository;

import com.qst.pojo.entity.InventoryHistory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 库存历史 Repository
 */
@Repository
public interface InventoryHistoryRepository extends JpaRepository<InventoryHistory, Integer> {
    
    /**
     * 根据站点ID和物品ID查询历史记录
     */
    List<InventoryHistory> findByStationIdAndItemIdOrderByCreatedAtDesc(Integer stationId, Integer itemId);
    
    /**
     * 根据站点ID查询历史记录
     */
    List<InventoryHistory> findByStationIdOrderByCreatedAtDesc(Integer stationId);
}

